<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"  isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>HomePage</title>
</head>
<body>
	<h1>another HomePage</h1>
	
	<a href="passwordPage">passwordPage</a>
	<form action="selfPage" method="post">
	    <input type="submit" value="selfPage(个人主页)">
	</form>
	
	
	<!-- 前端首先发送查询老师的请求 -->
	
	<p>请输入您要补课的年级和学科</p>
	<form action="search" method="post">
		<input type="radio" name="grade" value="1">一年级
		<input type="radio" name="grade" value="2">二年级
		<input type="radio" name="grade" value="3">三年级
		<input type="radio" name="grade" value="4">四年级
		<input type="radio" name="grade" value="5">五年级
		<input type="radio" name="grade" value="6">六年级<br>
				
		<input type="radio" name="grade" value="7">初一
		<input type="radio" name="grade" value="8">初二
		<input type="radio" name="grade" value="9">初三	
			
		<input type="radio" name="grade" value="10">高一
		<input type="radio" name="grade" value="11">高二
		<input type="radio" name="grade" value="12">高三<br>
		
		<input type="radio" name="course" value="1">语文
		<input type="radio" name="course" value="2">数学
		<input type="radio" name="course" value="3">英语
		
		<input type="radio" name="course" value="4">政治
		<input type="radio" name="course" value="5">历史
		<input type="radio" name="course" value="6">地理
		
		<input type="radio" name="course" value="7">物理
		<input type="radio" name="course" value="8">化学
		<input type="radio" name="course" value="9">生物<br>
		<input type="submit" value="搜索">
	</form>
	
	<!-- 前端也需要显示教师的列表 -->

	<c:if test="${empty requestScope.teacherList }">
		<p>暂无查询结果.</p>
	</c:if>
	
	<c:if test="${!empty requestScope.teacherList }">
		<p>已查询到如下教师信息</p>
		<table border="1" cellpadding="10" cellspacing="0">
			<tr>
				<th>教师</th>
				<th>课时费</th>
				<th>已上课时数</th>
			</tr>
			<!--     刚才写错了：RequestScope.teacherlist -->
			<c:forEach items="${requestScope.teacherList }" var="teacher">
				<tr>
					<!-- 我们需要一个点击进入教师详情页的按钮，可以用href来实现，也可以用form来实现 ，目前不会做
					<form action="teacherDetailPage">
						<input type="number" name="teacherID" value=${teacher.teacherID} hidden=true >
					</form>
					-->
					<td>${teacher.name }</td>
					<td>${teacher.fee }</td>
					<td>${teacher.experience}</td>
				</tr>
			</c:forEach>
		</table>
	</c:if>
	
	
</body>
</html>